﻿using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _03Net8Logging.Customs
{
    /// <summary>
    /// MySQL 日志组件提供者接口
    /// </summary>
    public class MySQLLoggerProvider : ILoggerProvider
    {
        private string _connectionString { set; get; }

        /// <summary>
        /// 提供日志
        /// </summary>
        /// <param name="connectionString"></param>
        public MySQLLoggerProvider(string connectionString)
        {
            _connectionString = connectionString;
        }

        public ILogger CreateLogger(string categoryName)
        {
            return new MySQLLogger(_connectionString);
        }

        public void Dispose()
        {

        }
    }
}
